# should inherit the definitions from the main Makefile
ifndef JVM
	JVM=java
endif

all: generate
	jikes +E -d ../../bin *.java

generate: AlloyPrepass.java AlloyParser.java
	cp ParseException.java.fix ParseException.java

AlloyPrepass.java: AlloyPrepass.jj
	$(JVM) -classpath ../../3rdptyjars/JavaCC.zip COM.sun.labs.javacc.Main AlloyPrepass.jj

AlloyParser.java: Alloy.jj
	$(JVM) -classpath ../../3rdptyjars/jtb.jar EDU.purdue.jtb.JTB -p alloy.parse -f -jd Alloy.jj
	$(JVM) -classpath ../../3rdptyjars/JavaCC.zip COM.sun.labs.javacc.Main jtb.out.jj

clean:
	rm -f *.class syntaxtree/*.java syntaxtree/*.class visitor/*.class
